﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace PuzzleDiamonds
{
    public class SceneSprite : SceneObject
    {
        protected Image m_spriteImage;

        public SceneSprite(Image pSpriteImage, Point pPosition, Point pDirection, double pSpeed)
            : base(pPosition, pDirection, pSpeed)
        {
            m_spriteImage = pSpriteImage;
            m_spriteImage.RenderTransform = m_xForm;
        }

        public SceneSprite(String pUriSprite, Point pPosition, Point pDirection, double pSpeed)
            : base(pPosition, pDirection, pSpeed)
        {
            m_spriteImage = new Image();
            m_spriteImage.Source = new Uri(pUriSprite, UriKind.Relative);
            m_spriteImage.Visibility = Visibility.Visible;
            m_spriteImage.RenderTransform = m_xForm;
        }

        public override void Update(double pTick)
        {
            base.Update(pTick);

            m_spriteImage.RenderTransform = m_xForm;
        }

        public override Visual GetVisualObject()
        {
            return m_spriteImage;
        }
    }
}
